<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sd" uri="/struts-dojo-tags" %>
<html>
<head><sd:head/>
<title>LM Design</title>
<link href="form.css" rel="stylesheet" type="text/css" />
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="stmenu.js"></script>
<script type="text/javascript">
    function getDistrictList() {
    	document.addLocation.action = "dstList.action";
        document.addLocation.method = "post";
        document.addLocation.submit();
    }
</script>
</head>
<body>
<div class="bodybox">
<div class="headerbar_top"> You are logged in as Admin !</div>
<div class="header">

</div>
<div class="wrapper">
<div class="navigation">
<a href="http://www.dhtml-menu-builder.com"  style="display:none;visibility:hidden;">Navigation Menu</a>
<s:if test="%{#webFramework=='Admin'}">
			<script type="text/javascript" src="admin.js"></script>
		</s:if>
		<s:if test="%{#webFramework=='Manager'}">
			<script type="text/javascript" src="locatationMngr.js"></script>
		</s:if>

</div>
<!-- navigation end-->

	<div class="content">
	<h4>Add Location</h4>
	<s:actionerror/>
	<s:fielderror></s:fielderror>
	 <s:form action="addLocation.action" method="post" onsubmit='validateForm()' name="addLocation" >
	<table>
			<tr>
			    <!-- <td class="right"><label for="locationCode">Enter Location Code</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left"><input type="text" name="locationCode" id="locationCode" tabindex="1" /></td> -->
			    <td align="left"><s:textfield id="locationCode" label="Enter Location Code" name="locationCode" tabindex="1"/>
			    </td>			    
			  </tr>
			<tr>
			<td align="left"><s:textfield id="name" label="Name" name="name" tabindex="2"/> </td>
			    <!-- <td class="right"><label for="name">Name</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left"><input type="text" name="name" id="name" tabindex="2" /></td> -->
			</tr>
			<tr>
				<td align="left">
					<s:select label="Category" id="category" headerKey="" headerValue="-- select --"
					 name="category" list="#{'Ashram':'Ashram','Naam-Charcha-Ghar':'Naam-Charcha-Ghar'}"  tabindex="3" />
			    </td>
			
			    <!-- <td class="right"><label for="category">Category</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left"><select name="category" size="1" tabindex="3" id="category">
				<option selected>-select-</option>
				<option>Ashram</option>
				<option>Naam-Charcha-Ghar</option>
				</select>
			    </td> -->
			</tr>
			
			<tr>
				<td align="left">
					<s:textarea  id="address" label="Address" name="address" tabindex="4">
					</s:textarea>
				</td>
			    <!-- <td class="right"><label for="address">Address</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left"><textarea rows="4" name="address" cols="23" tabindex="4" id="address"></textarea></td> -->
			  </tr>
			
			<tr>
				<td align="left">
					<s:select label="Country" id="country" headerKey="" headerValue="-- select --"
					 name="country" list="#{'India':'India'}"  tabindex="5" />
			    </td>
			    <!-- <td class="right"><label for="country">Country</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left"><select name="country" size="1" tabindex="8" id="country">
				<option>-select-</option>
				<option>Country</option>
				</select></td> -->
			</tr>
			<tr>
				<td align="left">
					<s:select label="Select State" id="stateNameList" headerKey="1" headerValue="-- select --"
					 name="state" list="stateNameList"  tabindex="6" onchange="getDistrictList()" />
			    </td>
			    <!-- <td class="right"><label for="state">State</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left"><select name="state" size="1" tabindex="7" id="state">
				<option>-select-</option>
				<option>State</option>
				</select></td> -->
			</tr>
			<tr>
			
				<td align="left">
					<s:select label="Select District" id="district" headerKey="" headerValue="-- select --"
					 name="district" list="districtNameList"  tabindex="7" />
			    </td>
			    <!-- <td class="right"><label for="district">District</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left"><select name="district" size="1" tabindex="6" id="district">
				<option>-select-</option>
				<option>District</option>
				</select></td> -->
			</tr>
			<tr>
			
				<td align="left">
					<s:textfield label="Tehsil/Block" id="block" name="block" tabindex="8" />
			    </td>
			    <!-- <td class="right"><label for="block">Tehsil/Block</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left"><select name="block" size="1" tabindex="5" id="block">
				<option>-select-</option>
				<option>Tehsil/Block</option>
				</select></td> -->
			</tr>
			<tr>
				<td align="left"><s:textfield id="landarea" label="Land In Area" name="landarea" tabindex="9"/> 
				</td>
			    <!-- <td class="right"><label for="landarea">Land In Area</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left">
				<input type="text" name="landarea"  tabindex="9"  id="landarea" />
				(Sq.Ft.)</td> -->
			</tr>
			<tr>
				<td align="left"><s:textfield id="landterm" label="Land Term" name="landterm" tabindex="10"/> 
				</td>
			    <!-- <td class="right"><label for="landterm">Land Term</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left">
				<input type="text" name="landterm"  tabindex="10" id="landterm" /></td> -->
			</tr>
			<tr>
				<td align="left">
					<s:select label="Land Type" id="landtype" headerKey="" headerValue="-- select --"
					 name="landtype" list="#{'Full Irrigation':'Full Irrigation','Semi Irrigation':'Semi Irrigation','Waste Land':'Waste Land','Garden Land':'Garden Land'}"  tabindex="11" />
			    </td>
			    <!-- <td class="right"><label for="landtype">Land Type</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left">
				<select name="landtype" size="1" tabindex="11" id="landtype">
				<option>-select-</option>
				<option>Full Irrigation</option>
				<option>Semi Irrigation</option>
				<option>Waste Land</option>
				<option>Garden Land</option>
				</select></td> -->
			</tr>
			<tr>
				<td align="left"><s:textfield id="runningft" label="running Ft" name="runningft" tabindex="12"/> 
				</td>
			    <!-- <td class="right"><label for="runningft">Running ft.</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left">
				<select name="runningft" size="1" tabindex="12" id="runningft">
				<option>-select-</option>
				<option>Running ft</option>
				<option>Boundary wall</option>
				</select></td> -->
			</tr>
			<tr>
				<td align="left"><s:textfield id="coveredarea" label="Covered Area" name="coveredarea" tabindex="13"/> 
				</td>
			    <!-- <td class="right"><label for="coveredarea">Covered Area</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left">
				<input type="text" name="coveredarea" tabindex="13" id="coveredarea" />
				(Sq.Ft.)</td> -->
			</tr>
			<tr>
				<td align="left"><s:textfield id="registeredname" label="Registered on Name" name="registeredname" tabindex="14"/> 
				</td>
			    <!-- <td class="right"><label for="registeredname">Registered on Name</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left">
				<input type="text" name="registeredname"  tabindex="14" id="registeredname" /></td> -->
			</tr>
			<tr>
				<td align="left"><s:textfield id="registerationno" label="Registration No." name="registerationno" tabindex="15"/> 
				</td>
			    <!-- <td class="right"><label for="registerationno">Registration No.</label> </td>
			    <td class="left">&nbsp;</td>
			    <td class="left">
				<input type="text" name="registerationno"  tabindex="15" id="registerationno" /></td> -->
			</tr>
			<tr>
				<td align="left">
				<sd:datetimepicker label="Registration Date" name="registereddate" id="registereddate"  displayFormat="yyyy-MM-dd"> </sd:datetimepicker>
				</td>					
			    <!-- <td class="right"><label for="registereddate">Registration Date</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left">
				<input type="text" name="registereddate"  tabindex="16" id="registereddate" /> 
				(dd/mm/yyyy)</td> -->
			</tr>
			<tr>
				<td align="left"><s:textfield id="subregistrar" label="Sub Registrar" name="subregistrar" tabindex="17"/> 
				</td>
			    <!-- <td class="right"><label for="subregistrar">Sub Registrar</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left">
				<input type="text" name="subregistrar"  tabindex="17" id="subregistrar" /></td> -->
			</tr>
			<tr>
				<td align="left"><s:textfield id="estvalue" label="Estimated Values" name="estvalue" tabindex="18"/> 
				</td>
			<!--     <td class="right"><label for="estvalue">Estimated Values</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left">
				<input type="text" name="estvalue"  tabindex="18" id="estvalue"  />
				Rs/-</td> -->
			</tr>
			<tr>
				<td align="left"><s:textfield id="stmpexp" label="Stamp Expenditure" name="stmpexp" tabindex="19"/> 
				</td>
			    <!-- <td class="right"><label for="stmpexp">Stamp Expenditure</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left">
				<input type="text" name="stmpexp"  tabindex="19"  id="stmpexp" />
				Rs/-</td> -->
			</tr>
			<tr>
				<td align="left"><s:textfield id="otherexp" label="Other Expenditure" name="otherexp" tabindex="20"/> 
				</td>
			    <!-- <td class="right"><label for="otherexp">Other Expenditure</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left">
				<input type="text" name="otherexp"  tabindex="20" id="otherexp" />
				Rs/-</td> -->
			</tr>
			<tr>
				<td align="left"><s:textfield id="regholder" label="Registry Holder" name="regholder" tabindex="21"/> 
				</td>
			    <!-- <td class="right"><label for="regholder">Registry Holder</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left">
				<input type="text" name="regholder"  tabindex="21"  id="regholder" /></td> -->
			</tr>
			<tr>
				<td align="left"><s:hidden  id="regcopy" label="Registry Copy" name="regcopy" tabindex="22"/> 
				</td>
			    <!-- <td class="right"><label for="regcopy">Registry Copy</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left"><input type="file" name="regcopy" size="50" tabindex="22" id="regcopy"></td> -->
			</tr>
			<tr>
				<td align="left"><s:hidden  id="buildingmap" label="Building Map" name="buildingmap" tabindex="23"/> 
				</td>
			    <!-- <td class="right"><label for="buildingmap">Building Map</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left"><input type="file" name="buildingmap" size="50" tabindex="23" id="buildingmap"></td> -->
			</tr>
			<tr>
				<td align="left">
				<s:radio id="CanteenOption"  label="Canteen Available" name="CanteenOption" list="#{'Yes':'Yes','No':'No'}"  tabindex="24"/>
				</td>
				
			    <!-- <td class="right"><label for="CanteenOption">Canteen Available</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left"> <label for="CanteenOption">Yes</label>
			    <input type="radio" name="CanteenOption" value="yes" tabindex="24" id="CanteenOption">
			    <label for="CanteenOption">No</label>
			    <input type="radio" name="CanteenOption" value="no" tabindex="25" id="CanteenOption">
			    </td> -->
			</tr>
			<tr>
				<td align="left"><s:textfield id="lndmark" label="Land Mark" name="lndmark" tabindex="25"/> 
				</td>
			    <!-- <td class="right"><label for="lndmark">Land Mark</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left">
				<input type="text" name="lndmark"  tabindex="26" id="lndmark" /></td> -->
			</tr>
			<tr>
				<td align="left"><s:textfield id="distance" label="Distance from main road" name="distance" tabindex="26"/> 
				</td>
			    <!-- <td class="right"><label for="distance">Distance from main road</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left">
				<input type="text" name="distance"  tabindex="27"  id="distance" /> 
				(K.M.)</td> -->
			</tr>
			<tr>
				<td align="left"><s:textfield id="responsible" label="Responsible Person" name="responsible" tabindex="27"/> 
				</td>
			    <!-- <td class="right"><label for="responsible">Responsible Person</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left">
				<input type="text" name="responsible"  tabindex="28" id="responsible" /></td> -->
			</tr>
			<tr>
				<td align="left">
					<s:select label="Status" id="status" headerKey="" headerValue="-- select --"
					 name="status" list="#{'Approved':'Approved','Rejected':'Rejected', 'Initiated':'Initiated'}"  tabindex="28" />
			    </td>
			    <!-- <td class="right"><label for="status">Status</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left">
				<select name="status" size="1" tabindex="29" id="status">
				<option>Approved</option>
				<option>Rejected</option>
				<option>Initiated</option>
				</select></td> -->
			</tr>
			<tr>
				<td align="left"><s:textfield id="balance" label="Total Balance" name="balance" tabindex="29"/> 
				</td>
			    <!-- <td class="right"><label for="balance">Total Balance</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left">
				<input type="text" name="balance"  tabindex="30" id="balance" /> 
				Rs/-</td> -->
			</tr>
			
			
			
			<tr>
			    <td class="right">&nbsp;</td>
			    <td class="left">&nbsp;</td>
			    <td class="left">&nbsp;</td>
			  </tr>
			
			<tr>
				<td align="left"><s:hidden  id="uploadImage" label="Image" name="uploadImage" tabindex="30"/> 
				</td>
			    <!-- <td class="right"><label for="uploadImage">Image</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left"><input type="file" name="uploadImage" size="50" tabindex="22" id="uploadImage" /></td>
			 -->
			</tr>
			<tr>
				<td align="left"><s:hidden id="uploadVideo" label="Video" name="uploadVideo" tabindex="31"/> 
				</td>
			    <!-- <td class="right"><label for="uploadVideo">Video</label></td>
			    <td class="left">&nbsp;</td>
			    <td class="left"><input type="file" name="uploadVideo" size="50" tabindex="23" id="uploadVideo" /></td> -->
			</tr>
			<tr>
			  <td class="right">&nbsp;</td>
			  <td class="left">&nbsp;</td>
			  <td class="left">&nbsp;</td>
			</tr>
			<tr>
				<td class="left">
					<s:submit name="Add" value="Add" type="button" align="left" tabindex="32" />	
					<s:reset value="Reset" name="reset" tabindex="33" ></s:reset>
				</td>
			  <!-- <td class="right">&nbsp;</td>
			  <td class="left">&nbsp;</td>
			  <td class="left"><input type="submit" name="Add" value="Add" tabindex="31" id="Add" />
			    <input type="reset" value="Reset" name="reset" tabindex="32" id="reset" /></td> -->
			</tr>
</table>
 <p>&nbsp;</p>
 </s:form>
</div>
<!-- content end-->
</div> 
<!-- wrapper end-->
<div class="bottom_strip"></div>
<div class="headerbar_bottom">
&copy; Copyright 2011. Dera Sacha Sauda, Sirsa-125055 (Haryana)
<br />
Designed By: DSS IT WING</div>
</div>

	<!-- JavaScript -->
<script type="text/javascript">

function validateForm(){
		
		var locCode = document.getElementById('locationCode').value;
	
		var locname = document.getElementById('name').value;
		var toReturn;
		//adding error message criteria
		var errMsg="";
		if(locCode==null || locCode==""){
			errMsg = errMsg + "Please enter location code \n";
		}
		if(locname==null || locname==""){
			errMsg = errMsg + "Please enter name \n";
		}
		//displaying error message
		if(errMsg==null || errMsg==""){
			toReturn=true;
			return true;
		} else{
			alert(errMsg);
			toReturn=false
			return false;
		} 
		return toReturn;
		}
		</script>
		
 <script type="text/javascript">
 function loadCity()
 {
   var Punjab=new Array("Ludhiana","Amritsar","Bathinda","Firozpur");
   var Haryana=new Array("Ambala", "Bhiwani", "Faridabad", "Fatehabad", "Gurgaon", "Hisar", "Jhajjar", "Jind", "Kaithal", "Karnal", "Kurukshetra", "Mahendragarh", "Mewat", "Palwal", "Panchkula", "Panipat", "Rewari", "Rohtak", "Sirsa","Sonipat", "Yamuna Nagar");

   var selectedBoxValue=document.frm.state.value;
   var i;
   var j;

   var cityLength=eval(selectedBoxValue).length;

   removeSelectboxOption();

   for(i=0;i<document.frm.state.options.length;i++)
   {
    if(selectedBoxValue==document.frm.state.options[i].value)
    {
      for(j=0;j<cityLength;j++)
      {
        document.frm.district.options[j]=new Option(eval(selectedBoxValue)[j],eval(selectedBoxValue)[j])
      }
    }
   }
 }

 function removeSelectboxOption()
 {
   var i;
   for(i=0;i<document.frm.district.options.length;i++)
   {
    document.frm.district.remove(i);
   }
 }
</script>
</body>
</html>
